//
//  PersonSignControl.m
//  FreeTime
//
//  Created by  on 16/8/27.
//  Copyright © 2016年 SRDZ.com. All rights reserved.
//

#import "PersonSignControl.h"
#import "Header.h"
@interface PersonSignControl ()<UITextViewDelegate>{
    UITextView *textV;
    UILabel * textViewPlace ,*numLbl;
}

@end

@implementation PersonSignControl

- (void)viewDidLoad {
    [super viewDidLoad];
    [self setupNav];
    [self setupUI];
}
#pragma mark -- selfStyle --
- (void)setupUI{
    self.navigationItem.title = @"个性签名";
    
    UIButton * rightBtn = [UIButton buttonWithType:UIButtonTypeCustom];
    rightBtn.frame = CGRectMake(0, 0, 50, 40);
//    [rightBtn addTarget:self action:@selector(pop) forControlEvents:UIControlEventTouchUpInside];
    [rightBtn setTitle:@"完成" forState:UIControlStateNormal];
    [rightBtn setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
    rightBtn.titleLabel.font = FONT(14);
    self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithCustomView:rightBtn];
    
    textV = [[UITextView alloc] initWithFrame:CGRectMake(10, 15, WindowWidth-20, 100)];
    textV.backgroundColor = [UIColor whiteColor];
    textV.layer.borderColor = [ImageUtil colorWithRgb:0xcccccc].CGColor;
    textV.layer.borderWidth = 1;
    textV.delegate = self;
    [self.view addSubview:textV];
    textViewPlace = [[UILabel alloc] initWithFrame:CGRectMake(5, 4, 190, 20)];
    textViewPlace.font = FONT(12);
    textViewPlace.textColor = [ImageUtil colorWithRgb:0xcccccc];
    textViewPlace.text = @"描述下您的个性签名, 让大家感兴趣吧";
    [textV addSubview:textViewPlace];
    numLbl = [ReduceCode creatLabelWithFrame:CGRectMake((WindowWidth-80)/2, CGRectGetMaxY(textV.frame)+10, 70, 15) title:@"0/50" titleColor:[ImageUtil colorWithRgb:0xb3b3b3] font:12 textAlignment:2];
    
    
    
}
#pragma mark textViewDelegate
- (void)textViewDidChange:(UITextView *)textView;

{
    if ([ToolUtil isBlank:textView.text]) {
        textViewPlace.hidden = NO;
    }else {
        textViewPlace.hidden = YES;
    }
}



@end
